//
//  NovelAlbumNextView.m
//  A_program
//
//  Created by dlios on 15-5-25.
//  Copyright (c) 2015年 BayMax. All rights reserved.
//

#import "NovelAlbumNextView.h"
#import "NovelAlbumHeaderModel.h"
@implementation NovelAlbumNextView

- (void)dealloc
{
    [super dealloc];
    
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createAlbumNext];
    }
    return self;
}
- (void)createAlbumNext{
    self.subjectLable = [[UILabel alloc]initWithFrame:CGRectMake(20, 20, 80, 20)];
    [self addSubview:self.subjectLable];
    self.subjectLable.text = @"专辑名称:";
    [self.subjectLable release];

    self.subjectTextLable = [[UILabel alloc]initWithFrame:CGRectMake(105 , 20, 150, 20)];
    [self addSubview:self.subjectTextLable];
    [self.subjectTextLable release];
    
    self.createrLable = [[UILabel alloc]initWithFrame:CGRectMake(20, 70, 60, 20)];
    self.createrLable.text = @"创建人:";
    [self addSubview:self.createrLable];
    [self.createrLable release];
    
    self.createrTextLable = [[UILabel alloc]initWithFrame:CGRectMake(85, 70, 150, 20)];
    [self addSubview:self.createrTextLable];
    [self.createrTextLable release];
    
    self.introLable = [[UILabel alloc]initWithFrame:CGRectMake(20, 120, 40, 20)];
    [self addSubview:self.introLable];
    self.introLable.text = @"简介:";
    [self.introLable release];
    
    self.introTextScrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(65,120, [UIScreen mainScreen].bounds.size.width - 105, 380)];
    [self addSubview:self.introTextScrollView];
    [self.introTextScrollView release];

    self.introLableText = [[UILabel alloc]initWithFrame:CGRectMake(70, 120, [UIScreen mainScreen].bounds.size.width - 115, 100)];
    [self.introTextScrollView addSubview:self.introLableText];
    [self.introLableText release];

    [self.subjectLable setBackgroundColor:[UIColor redColor]];
    [self.subjectTextLable setBackgroundColor:[UIColor redColor]];
    
    [self.createrLable setBackgroundColor:[UIColor redColor]];
    [self.createrTextLable setBackgroundColor:[UIColor redColor]];
    
    [self.introLable setBackgroundColor:[UIColor redColor]];
    [self.introLableText setBackgroundColor:[UIColor blueColor]];
    [self.introTextScrollView setBackgroundColor:[UIColor redColor]];
    
    

    
    
}

- (void)createStrHeigh:(NovelAlbumHeaderModel *)model{
    
    self.subjectTextLable.text = model.title;
    
    self.createrTextLable.text = model.nickname;
    
    NSString *myStr = model.intro;
    //定义一个字典将他的字体大小名 系统大小为17
    NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:17]};
    //字数宽度 最高1000
    CGRect rect = [myStr boundingRectWithSize:CGSizeMake([UIScreen mainScreen].bounds.size.width - 115, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    self.introLableText.numberOfLines = 0;
    [self.introLableText setFrame:CGRectMake(5, 5, [UIScreen mainScreen].bounds.size.width - 115,rect.size.height)];
    self.introLableText.text = model.intro;
    self.introTextScrollView.contentSize = CGSizeMake(10, rect.size.height+20);

}

@end
